Rationalising Eiffel's Type System

نویسنده

  • A J H Simons
چکیده

forbidding the redefinition of attribute types, inverting the routine argument redefinition rule to observe contravariance (redefined arguments should have more general types), judging type compatibility between parameterised types after replacing the type parameters and introducing an explicit type attribute scheme to handle Eiffel's anchored types. Contravariance is a counterintuitive finding for subtyping models of inheritance because it prevents the uniform specialisation of function arguments and results. It forbids the replacement of a function f:τ→τ closed over a type τ by a function f:σ→σ closed over a subtype σ ⊆ τ [Cardelli 86]. While insisting that Eiffel should obey the contravariant rule, Cook ruefully admits that: Eiffel has too many polymorphic type mechanisms: conformance, generic and anchored types, some of which are flawed and others redundant. Cook's suggested 1989 corrections to Eiffel's type rules, most notably to make inheritance obey subtyping, were not accepted by Meyer, Eiffel's designer, who found them too restrictive. F-bounded polymorphism has since been widely proposed as an alternative to subtyping for describing the inherited self-type. Here, we adopt F-bounds for all polymorphic types in Eiffel, giving the flexibility Meyer wants. We analyse the intended expressiveness of conformance, anchored and generic types and show how these can all be replaced by a single, elegant parametric mechanism. "[Contravariance] has the unfortunate effect of making argument type redefinition almost useless, since it is usually not very useful to allow a redefined method to accept a larger class of arguments" [Cook 89b, p62].

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Genericity in Object-Oriented Programming Languages

Genericity is one of the most powerful means for obtaining flexibility in programming with statically typed programming languages. Genericity constructs take on very different forms, the choice of which has a considerable impact on expressiveness, modularity, static checkability and efficiency properties of programs. This tutorial presents an in-depth discussion of the history, origins, and str...

متن کامل

Molecular Models for the Core Components of the Flagellar Type-III Secretion Complex

We show that by using a combination of computational methods, consistent three-dimensional molecular models can be proposed for the core proteins of the type-III secretion system. We employed a variety of approaches to reconcile disparate, and sometimes inconsistent, data sources into a coherent picture that for most of the proteins indicated a unique solution to the constraints. The range of d...

متن کامل

Rationalising the Penn World Table: True Multilateral Indices for International Comparisons of Real Income

Real incomes are routinely compared internationally using methods which "correct" for deviations from purchasing power parity. The most widely used of these is the Geary method which, though theoretically suspect, underlies the Penn World Table. This paper provides a theoretical foundation for the Geary method which I call the GAIA ("Geary-Allen International Accounts") System. I show that the ...

متن کامل

SYMPOSIUM ON EVIDENCE BASED MEDICINE Ethics, EBM, and hospital management

Matters of hospital management do not figure prominently on the medical ethics agenda. However, management decisions that have to be taken in the area of hospital care are in fact riddled with ethical questions and do have significant impact on patients, staff members, and the community being served. In this decision making process evidence based medicine (EBM) plays an increasingly important r...

متن کامل

Randomised controlled trials relevant to aggressive and violent people, 1955-2000: a survey.

BACKGROUND Randomised trials remain the gold standard for evaluating health interventions. This applies to the criminal justice system as well as to health. AIMS To identify and survey randomised trials relevant to forensic mental health services. METHOD We searched 29 electronic bibliographic databases and acquired randomised trials involving sex offenders, arsonists or people clearly and ...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1995